package club.guadazi.wemarket.util.excel;

import java.text.ParseException;
import java.text.SimpleDateFormat;

public enum ExcelCellDataTransfer {
    NONE() {
        @Override
        Object parse(String s) {
            return null;
        }
    },
    Date() {
        @Override
        Object parse(String s) {
            java.util.Date date = null;
            if (s == null || s.length() == 0) {
                return null;
            }
            final String dateFormat = "yyyy-MM-dd HH:mm:ss";
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat);
            try {
                date = simpleDateFormat.parse(s);
            } catch (ParseException e) {
                e.printStackTrace();
            }
            return date;
        }
    };

    abstract Object parse(String s);

}
